package oaSystem.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import oaSystem.entity.Employee;
import oaSystem.entity.Message;
import oaSystem.entity.MessageAttachment;

public interface MessageMapper {
	Message fetchMessageById(int id);
	
	List<Message> getMessageBySearch(
			@Param("sessionId")Integer sessionId,
			@Param("categoryId")Integer categoryId,
			@Param("skip")int skip,
			@Param("takes")int takes,
			@Param("search")String search);

	void addMessageToDrafts(@Param("message")Message message,
							@Param("receiver_ids")List<Employee> receiver_ids,
							@Param("messageAttachment")MessageAttachment messageAttachment);
	
	void addMessage(Message message);
	
	void updateMessage(Message message);
	
	void sendMessage(Message message);
	
	void deleteMessageByMessageId(Integer messageId);
	
	int getMessageCount(@Param("sessionId")Integer sessionId,
						@Param("categoryId")Integer categoryId,
						@Param("search")String search);
	
}
